//
//  PieMenuViewController.m
//  mobilePhoneAssistant
//
//  Created by 方灵勇 on 15/1/28.
//  Copyright (c) 2015年 Fangfang. All rights reserved.
//

#import "PieMenuViewController.h"
#import "ZQLRotateView.h"
#import "DetailPageViewController.h"

@interface PieMenuViewController () <ZQLRotateViewDelegate>

@property (nonatomic,retain) ZQLRotateView *rotateView;//扇子形状的menu.

@end

@implementation PieMenuViewController

- (void)dealloc
{
    [_rotateView release];
    [super dealloc];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.rotateView.delegate = self;
    
    
    //调用 interfaceLayout方法.
    [self interfaceLayout];
    
    // Do any additional setup after loading the view.
}
- (void)interfaceLayout
{
    NSMutableArray *arr = [NSMutableArray array];
    for (NSInteger i = 0; i < 10; i++) {
        arr[i] = [[[self.menDic objectForKey:@"rank"]objectAtIndex:i]objectForKey:@"name"];
    }
    self.rotateView = [[ZQLRotateView alloc] initWithTitleArrays:arr];
    [_rotateView showMenu];

}

- (void)ZQLRotateView:(UIView *)view DidChoose:(NSInteger)tag
{
    DetailPageViewController *detailPage = [[DetailPageViewController alloc]init];
    
    detailPage.rankId = [[[self.menDic objectForKey:@"rank"]objectAtIndex:tag]objectForKey:@"id"];
    [self.navigationController pushViewController:detailPage animated:YES];
    [detailPage release];
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
